package com.ldk.springboot2021.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class JSONResult<T> {
    private Integer state;//返回给前端的状态码
    private String message;//返回给前端的提示
//    private Object data;//返回的具体数据
    private T data;

    //不需要封装数据的时候：两个参数的构造
    public JSONResult(Integer state, String message) {
        this.state = state;
        this.message = message;
    }
}
